use thiserror::Error;

#[derive(Error, Debug)]
pub enum SystemError {
    #[error("Can't invoke \"uname\" to get arch : {0}")]
    ArchError(String),
    // bail!("can't create {} lock on {}", lock_path, descr)
    #[error("Can't create {des:?} lock on {lock_path:?}")]
    FailedCreateLock { lock_path: String, des: String },
    // bail!("Failed to acquire rdnf_instance lock")
    #[error("Failed to acquire rdnf_instance lock , maybe an instance already exists")]
    InstanceExist,
    #[error("Failed to acquire rpmdb.sqlite lock , maybe an instance already exists")]
    RpmdbLocked,
}

#[derive(Error, Debug)]
pub enum DownloadError {
    #[error("The network site connection cannot be reached ; {0}")]
    Network(String),
    #[error("Io error")]
    IoError(String),
    #[error("Can't get systime")]
    TimeError,
}
